﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OrderManager.DataAccess.Repositories;

namespace CustomersWithOrders
{
    public partial class CustomerAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //RepositoryFactory.getCustomerRepository().Create(txtCustomerName.Text, txtCustomerAdress.Text);
                //todo return to revious and DataBind
            }
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            ((Button) sender).Attributes.Add("CauseValidation","false");
            
            Response.Redirect("/default.aspx");
        }
    }
}